package com.koolearn.toefl2019.home.adapter;

/**
 * Time: 2022/3/29 10:07 上午
 * Author: leixun
 * Email: leixun33@163.com
 * <p>
 * Description:
 */

import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Message;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.text.style.StyleSpan;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.animation.AccelerateInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.koolearn.toefl2019.R;
import com.koolearn.toefl2019.home.adapter.DailyChooseAdapter.a;
import com.ximalaya.demo.HolderAdapter;
import com.ximalaya.ting.android.framework.adapter.HolderAdapter.a;
import com.ximalaya.ting.android.framework.manager.ImageManager;
import com.ximalaya.ting.android.host.activity.base.BaseFragmentActivity2;
import com.ximalaya.ting.android.host.fragment.BaseFragment2;
import com.ximalaya.ting.android.host.util.view.p;
import com.ximalaya.ting.android.main.adapter.mulitviewtype.ItemModel;
import com.ximalaya.ting.android.main.model.podcast.HomeDailyChoiceItemVO;
import com.ximalaya.ting.android.main.model.podcast.HomeDailyChoiceVO;
import com.ximalaya.ting.android.main.util.ui.h;
import com.ximalaya.ting.android.main.view.BannerIndicator;
import com.ximalaya.ting.android.main.view.ControlViewpager;
import com.ximalaya.ting.android.xmtrace.h.k;

import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.util.List;

import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import kotlin.jvm.internal.Lambda;

public class DailyChooseAdapter
        extends a<a>
{
    private volatile int q;
    private volatile boolean r = false;
    private volatile boolean s = false;
    private float t = 0.0F;
    private float u = 0.0F;
    private Handler v = null;

    public DailyChooseAdapter(BaseFragment2 paramBaseFragment2, b paramb)
    {
        super(paramBaseFragment2, paramb);
    }

    private void a(long paramLong)
    {
        int i;
        if ((com.ximalaya.ting.android.host.util.k.e.b(this.m) == paramLong) && (com.ximalaya.ting.android.opensdk.player.a.a(this.m).K())) {
            i = 1;
        } else {
            i = 0;
        }
        Object localObject1 = new h.k().d(27879);
        Object localObject2 = new StringBuilder();
        ((StringBuilder)localObject2).append(paramLong);
        ((StringBuilder)localObject2).append("");
        localObject2 = ((h.k)localObject1).b("trackId", ((StringBuilder)localObject2).toString());
        if (i != 0) {
            localObject1 = "������";
        } else {
            localObject1 = "������";
        }
        localObject1 = ((h.k)localObject2).b("playStatus", (String)localObject1);
        localObject2 = new StringBuilder();
        ((StringBuilder)localObject2).append(e());
        ((StringBuilder)localObject2).append("");
        ((h.k)localObject1).b("categoryId", ((StringBuilder)localObject2).toString()).b("currPage", "podcast").a();
    }

    private void a(ViewPager paramViewPager)
    {
        try
        {
            Field localField = ViewPager.class.getDeclaredField("mScroller");
            localField.setAccessible(true);
            com.ximalaya.ting.android.framework.view.a locala = new com.ximalaya.ting.android.framework.view.a(paramViewPager.getContext(), new AccelerateInterpolator());
            localField.set(paramViewPager, locala);
            locala.a(300);
            return;
        }
        catch (Exception paramViewPager)
        {
            for (;;) {}
        }
    }

    private static void a(DailyChooseAdapter paramDailyChooseAdapter, HomeDailyChoiceItemVO paramHomeDailyChoiceItemVO, View paramView)
    {
        com.ximalaya.ting.android.xmtrace.e.a(paramView);
        paramDailyChooseAdapter.b(paramHomeDailyChoiceItemVO, paramView);
    }

    private void a(HomeDailyChoiceItemVO paramHomeDailyChoiceItemVO, ImageView paramImageView1, ImageView paramImageView2)
    {
        if (paramHomeDailyChoiceItemVO == null)
        {
            return;
        }
        paramImageView2.setOnClickListener(new -..Lambda.DailyChooseAdapter.bBWxMDh-L7-dDQme0p7V_hHji0Y(this, paramHomeDailyChoiceItemVO));
        paramImageView1.setOnClickListener(new -..Lambda.DailyChooseAdapter.0ORP7ttx0pD7YR49bblB_wq4zho(this, paramHomeDailyChoiceItemVO));
        paramHomeDailyChoiceItemVO = paramHomeDailyChoiceItemVO.getCoverPath();
        if (!TextUtils.isEmpty(paramHomeDailyChoiceItemVO)) {
            ImageManager.b(this.m).b(paramImageView1, paramHomeDailyChoiceItemVO, R.drawable.host_default_album, Bitmap.Config.ARGB_8888, new -..Lambda.DailyChooseAdapter.-THTvR84QcRZryN2h3_THq2H45o(paramImageView1, paramImageView2));
        }
    }

    private void a(List<HomeDailyChoiceItemVO> paramList, a parama)
    {
        int i = 0;
        while (i < paramList.size())
        {
            a(parama.w[i], ((HomeDailyChoiceItemVO)paramList.get(i)).getTrackId());
            i += 1;
        }
    }

    private void b(long paramLong)
    {
        h.k localk = new h.k().d(27877);
        StringBuilder localStringBuilder = new StringBuilder();
        localStringBuilder.append(paramLong);
        localStringBuilder.append("");
        localk.b("trackId", localStringBuilder.toString()).b("currPage", "podcast").a();
    }

    private void b(final a parama, final int paramInt)
    {
        AnimatorSet localAnimatorSet = new AnimatorSet();
        final FrameLayout localFrameLayout1 = parama.u[((this.q + 1) % paramInt)];
        FrameLayout localFrameLayout3 = parama.v[((this.q + 1) % paramInt)];
        final FrameLayout localFrameLayout2 = parama.x[((this.q + 1) % paramInt)];
        localAnimatorSet.playTogether(
                new Animator[] {
                        ObjectAnimator.ofFloat(localFrameLayout1, "scaleX", new float[] { 1.0F, this.u }),
                        ObjectAnimator.ofFloat(localFrameLayout1, "scaleY", new float[] { 1.0F, this.u }),
                        ObjectAnimator.ofFloat(localFrameLayout1, "rotation", new float[] { -10.0F, 0.0F }),
                        ObjectAnimator.ofFloat(localFrameLayout1, "translationY", new float[] { 0.0F, 54.0F }),
                        ObjectAnimator.ofFloat(localFrameLayout1, "translationX", new float[] { 0.0F, 8.0F }),
                        ObjectAnimator.ofFloat(localFrameLayout3, "alpha", new float[] { 0.6F, 0.0F }) });
        if (paramInt == 3)
        {
            localFrameLayout3 = parama.u[((this.q + 2) % paramInt)];
            localAnimatorSet.playTogether(new Animator[] {
                    ObjectAnimator.ofFloat(localFrameLayout3, "scaleX", new float[] { 1.0F, this.t }),
                    ObjectAnimator.ofFloat(localFrameLayout3, "scaleY", new float[] { 1.0F, this.t }),
                    ObjectAnimator.ofFloat(localFrameLayout3, "rotation", new float[] { -25.0F, -10.0F }),
                    ObjectAnimator.ofFloat(localFrameLayout3, "translationY", new float[] { 0.0F, 54.0F }),
                    ObjectAnimator.ofFloat(localFrameLayout3, "translationX", new float[] { 0.0F, 14.0F }) });
        }
        localAnimatorSet.setDuration(250L);
        localAnimatorSet.addListener(new Animator.AnimatorListener()
        {
            public void onAnimationCancel(Animator paramAnonymousAnimator) {}

            public void onAnimationEnd(Animator paramAnonymousAnimator)
            {
                localFrameLayout1.setScaleX(1.0F);
                localFrameLayout1.setScaleY(1.0F);
                localFrameLayout1.setTranslationX(0.0F);
                localFrameLayout1.setTranslationY(0.0F);
                localFrameLayout1.setLayoutParams(parama.z[0]);
                localFrameLayout2.setVisibility(0);
                if (paramInt == 3)
                {
                    paramAnonymousAnimator = parama.u[((DailyChooseAdapter.b(DailyChooseAdapter.this) + 2) % paramInt)];
                    paramAnonymousAnimator.setScaleX(1.0F);
                    paramAnonymousAnimator.setScaleY(1.0F);
                    paramAnonymousAnimator.setTranslationX(0.0F);
                    paramAnonymousAnimator.setTranslationY(0.0F);
                    paramAnonymousAnimator.setLayoutParams(parama.z[1]);
                }
                DailyChooseAdapter.d(DailyChooseAdapter.this);
                DailyChooseAdapter.a(DailyChooseAdapter.this, false);
            }

            public void onAnimationRepeat(Animator paramAnonymousAnimator) {}

            public void onAnimationStart(Animator paramAnonymousAnimator) {}
        });
        localAnimatorSet.start();
    }

    private static void b(DailyChooseAdapter paramDailyChooseAdapter, HomeDailyChoiceItemVO paramHomeDailyChoiceItemVO, View paramView)
    {
        com.ximalaya.ting.android.xmtrace.e.a(paramView);
        paramDailyChooseAdapter.a(paramHomeDailyChoiceItemVO, paramView);
    }

    private void c(long paramLong)
    {
        h.k localk = new h.k().a(27878).a("slipPage");
        StringBuilder localStringBuilder = new StringBuilder();
        localStringBuilder.append(paramLong);
        localStringBuilder.append("");
        localk.b("trackId", localStringBuilder.toString()).b("currPage", "podcast").a();
    }

    private void c(final a parama, int paramInt)
    {
        Object localObject = (RelativeLayout.LayoutParams)h.a(parama.c.getLayoutParams(), RelativeLayout.LayoutParams.class);
        if (localObject != null)
        {
            int i;
            if (paramInt == 3)
            {
                i = this.e;
            }
            else
            {
                if (paramInt == 2) {
                    i = this.a;
                } else {
                    i = this.d;
                }
                i = -i;
            }
            ((RelativeLayout.LayoutParams)localObject).topMargin = i;
            parama.c.setLayoutParams((ViewGroup.LayoutParams)localObject);
        }
        localObject = (RelativeLayout.LayoutParams)h.a(parama.t.getLayoutParams(), RelativeLayout.LayoutParams.class);
        if (localObject != null)
        {
            if (paramInt == 1) {
                paramInt = this.k;
            } else {
                paramInt = this.l;
            }
            ((RelativeLayout.LayoutParams)localObject).topMargin = paramInt;
            parama.t.setLayoutParams((ViewGroup.LayoutParams)localObject);
        }
        localObject = new ViewTreeObserver.OnGlobalLayoutListener()
        {
            public void onGlobalLayout()
            {
                if ((parama.a.getWidth() > 0) && (parama.m.getMeasuredHeight() > 0) && (parama.n.getMeasuredHeight() > 0) && (parama.o.getMeasuredHeight() > 0))
                {
                    DailyChooseAdapter.a(DailyChooseAdapter.this, parama.m.getMeasuredHeight() * 1.0F / parama.n.getMeasuredHeight());
                    DailyChooseAdapter.b(DailyChooseAdapter.this, parama.n.getMeasuredHeight() * 1.0F / parama.o.getMeasuredHeight());
                    w.a(parama.a.getViewTreeObserver(), this);
                }
            }
        };
        parama.a.getViewTreeObserver().addOnGlobalLayoutListener((ViewTreeObserver.OnGlobalLayoutListener)localObject);
    }

    private void j()
    {
        Object localObject = this.v;
        if (localObject != null)
        {
            localObject = ((Handler)localObject).obtainMessage(1);
            this.v.sendMessageDelayed((Message)localObject, 2000L);
        }
    }

    private void k()
    {
        Handler localHandler = this.v;
        if ((localHandler != null) && (localHandler.hasMessages(1))) {
            this.v.removeMessages(1);
        }
    }

    private void l()
    {
        if (!this.s)
        {
            this.s = true;
            k();
            return;
        }
        if (this.r)
        {
            return;
        }
    }

    public View a(LayoutInflater paramLayoutInflater, int paramInt, ViewGroup paramViewGroup)
    {
        paramLayoutInflater = com.ximalaya.commonaspectj.a.a(paramLayoutInflater, R.layout.main_item_daily_choose, paramViewGroup, false);
        return paramLayoutInflater;
    }

    protected void a()
    {
        j();
    }

    public void a(int paramInt, final ItemModel paramItemModel, final a parama)
    {
        if ((paramItemModel != null) && ((paramItemModel.getObject() instanceof HomeDailyChoiceVO)) && (parama != null))
        {
            Object localObject = (HomeDailyChoiceVO)paramItemModel.getObject();
            final List localList = ((HomeDailyChoiceVO)localObject).getList();
            if (w.a(localList))
            {
                return;
            }
            paramItemModel = (HomeDailyChoiceItemVO)localList.get(this.q % localList.size());
            if (paramItemModel != null) {
                c(paramItemModel.getTrackId());
            }
            a(localList, parama);
            if ((!h()) && (parama.t.getAdapter() != null))
            {
                return;
            }
            k();
            this.q = 0;
            int i = localList.size();
            if (i == 3)
            {
                h.a(0, new View[] { parama.o, parama.n, parama.s });
            }
            else if (i == 2)
            {
                h.a(4, new View[] { parama.o });
                h.a(0, new View[] { parama.n, parama.s });
            }
            else if (i == 1)
            {
                h.a(4, new View[] { parama.o, parama.n });
                h.a(4, new View[] { parama.s });
            }
            c(parama, i);
            paramInt = 0;
            while (paramInt < i)
            {
                a((HomeDailyChoiceItemVO)localList.get(paramInt), parama.y[paramInt], parama.w[paramInt]);
                paramInt += 1;
            }
            if (!TextUtils.isEmpty(((HomeDailyChoiceVO)localObject).getModuleName())) {
                paramItemModel = ((HomeDailyChoiceVO)localObject).getModuleName();
            } else {
                paramItemModel = "������������";
            }
            parama.b.setText(paramItemModel);
            paramItemModel = new b(localList, this.m, ((HomeDailyChoiceVO)localObject).getBgImg());
            parama.t.setClickListener(new -..Lambda.DailyChooseAdapter.gFrOaxorOjwbZQ4nB_oDNMGQA7U(this, parama, localList));
            parama.t.setCanGoLeft(false);
            localObject = parama.t;
            boolean bool;
            if (i >= 2) {
                bool = true;
            } else {
                bool = false;
            }
            ((ControlViewpager)localObject).setCanGoRight(bool);
            parama.t.setAdapter(paramItemModel);
            if (i > 1)
            {
                this.s = false;
                a(parama.t);
                parama.t.addOnPageChangeListener(new ViewPager.OnPageChangeListener()
                {
                    public void onPageScrollStateChanged(int paramAnonymousInt)
                    {
                        if (paramAnonymousInt == 1) {
                            DailyChooseAdapter.c(DailyChooseAdapter.this);
                        }
                    }

                    public void onPageScrolled(int paramAnonymousInt1, float paramAnonymousFloat, int paramAnonymousInt2)
                    {
                        paramItemModel.a(paramAnonymousInt1, 1.0F - paramAnonymousFloat * 2.0F);
                    }

                    public void onPageSelected(int paramAnonymousInt)
                    {
                        DailyChooseAdapter.this.a(parama, localList.size());
                    }
                });
                parama.s.a(parama.t, i);
                this.v = new c(parama);
                j();
            }
            else
            {
                this.s = true;
            }
            return;
        }
    }

    void a(final a parama, final int paramInt)
    {
        if ((!this.r) && (paramInt > 1) && (paramInt <= 3))
        {
            this.r = true;
            final FrameLayout localFrameLayout1 = parama.u[(this.q % paramInt)];
            final FrameLayout localFrameLayout2 = parama.x[(this.q % paramInt)];
            ObjectAnimator localObjectAnimator1 = ObjectAnimator.ofFloat(localFrameLayout1, "rotation", new float[] { 0.0F, 10.0F });
            ObjectAnimator localObjectAnimator2 = ObjectAnimator.ofFloat(localFrameLayout1, "alpha", new float[] { 1.0F, 0.0F });
            ObjectAnimator localObjectAnimator3 = ObjectAnimator.ofFloat(localFrameLayout1, "translationY", new float[] { 0.0F, 74.0F });
            final FrameLayout localFrameLayout3 = parama.v[(this.q % paramInt)];
            localFrameLayout3.setAlpha(0.0F);
            AnimatorSet localAnimatorSet = new AnimatorSet();
            localAnimatorSet.playTogether(new Animator[] { localObjectAnimator1, localObjectAnimator2, localObjectAnimator3 });
            localAnimatorSet.setDuration(150L);
            localAnimatorSet.addListener(new Animator.AnimatorListener()
            {
                public void onAnimationCancel(Animator paramAnonymousAnimator) {}

                public void onAnimationEnd(Animator paramAnonymousAnimator)
                {
                    if ((localFrameLayout1.getParent() instanceof ViewGroup)) {
                        ((ViewGroup)localFrameLayout1.getParent()).removeView(localFrameLayout1);
                    }
                    localFrameLayout1.setTranslationY(0.0F);
                    localFrameLayout1.setAlpha(1.0F);
                    localFrameLayout3.setAlpha(0.6F);
                    localFrameLayout2.setVisibility(View.VISIBLE);
                    int i = paramInt;
                    if (i == 3)
                    {
                        localFrameLayout1.setRotation(-25.0F);
                        parama.c.addView(localFrameLayout1, 1, parama.z[2]);
                    }
                    else if (i == 2)
                    {
                        localFrameLayout1.setRotation(-10.0F);
                        parama.c.addView(localFrameLayout1, 2, parama.z[1]);
                    }
                    DailyChooseAdapter.a(DailyChooseAdapter.this, parama, paramInt);
                }

                public void onAnimationRepeat(Animator paramAnonymousAnimator) {}

                public void onAnimationStart(Animator paramAnonymousAnimator) {}
            });
            localAnimatorSet.start();
            return;
        }
    }

    public void a(boolean paramBoolean)
    {
        if (paramBoolean) {
            j();
        } else {
            k();
        }
    }

    public a b(View paramView)
    {
        paramView = new a(paramView);
        return paramView;
    }

    protected void b()
    {
        k();
    }

    static class a
            extends HolderAdapter.a
    {
        View a;
        TextView b;
        RelativeLayout c;
        ImageView d;
        ImageView e;
        ImageView f;
        ImageView g;
        ImageView h;
        ImageView i;
        FrameLayout j;
        FrameLayout k;
        FrameLayout l;
        FrameLayout m;
        FrameLayout n;
        FrameLayout o;
        FrameLayout p;
        FrameLayout q;
        FrameLayout r;
        BannerIndicator s;
        ControlViewpager t;
        FrameLayout[] u;
        FrameLayout[] v;
        ImageView[] w;
        FrameLayout[] x;
        ImageView[] y;
        RelativeLayout.LayoutParams[] z;

        public a(View paramView)
        {
            this.a = paramView.findViewById(R.id.main_daily_root_rl);
            this.c = ((RelativeLayout)paramView.findViewById(R.id.main_cover_container_fl));
            this.b = ((TextView)paramView.findViewById(R.id.main_daily_choose_title));
            this.f = ((ImageView)paramView.findViewById(R.id.card_3));
            this.e = ((ImageView)paramView.findViewById(R.id.card_2));
            this.d = ((ImageView)paramView.findViewById(R.id.card_1));
            this.g = ((ImageView)paramView.findViewById(R.id.card_1_play_iv));
            this.h = ((ImageView)paramView.findViewById(R.id.card_2_play_iv));
            this.i = ((ImageView)paramView.findViewById(R.id.card_3_play_iv));
            this.j = ((FrameLayout)paramView.findViewById(R.id.card_1_play_fl));
            this.k = ((FrameLayout)paramView.findViewById(R.id.card_2_play_fl));
            this.l = ((FrameLayout)paramView.findViewById(R.id.card_3_play_fl));
            this.m = ((FrameLayout)paramView.findViewById(R.id.card_1_fl));
            this.n = ((FrameLayout)paramView.findViewById(R.id.card_2_fl));
            this.o = ((FrameLayout)paramView.findViewById(R.id.card_3_fl));
            this.p = ((FrameLayout)paramView.findViewById(R.id.card_1_mask));
            this.q = ((FrameLayout)paramView.findViewById(R.id.card_2_mask));
            this.r = ((FrameLayout)paramView.findViewById(R.id.card_3_mask));
            this.s = ((BannerIndicator)paramView.findViewById(R.id.main_banner_indicator));
            this.t = ((ControlViewpager)paramView.findViewById(R.id.main_view_pager));
            paramView = this.m;
            this.u = new FrameLayout[] { paramView, this.n, this.o };
            this.v = new FrameLayout[] { this.p, this.q, this.r };
            this.y = new ImageView[] { this.d, this.e, this.f };
            this.w = new ImageView[] { this.g, this.h, this.i };
            this.x = new FrameLayout[] { this.j, this.k, this.l };
            RelativeLayout.LayoutParams[] arrayOfLayoutParams = new RelativeLayout.LayoutParams[3];
            this.z = arrayOfLayoutParams;
            arrayOfLayoutParams[0] = ((RelativeLayout.LayoutParams)s.a(paramView.getLayoutParams(), RelativeLayout.LayoutParams.class));
            this.z[1] = ((RelativeLayout.LayoutParams)s.a(this.n.getLayoutParams(), RelativeLayout.LayoutParams.class));
            this.z[2] = ((RelativeLayout.LayoutParams)s.a(this.o.getLayoutParams(), RelativeLayout.LayoutParams.class));
        }
    }

    class b
            extends PagerAdapter
    {
        private SparseArray<View> b;
        private List<HomeDailyChoiceItemVO> c;
        private Context d;
        private final int e;
        private final int f;
        private String g;

        public b(Context paramContext, String paramString)
        {
            this.b = new SparseArray();
            this.c = paramContext;
            this.d = paramString;
            this.e = com.ximalaya.ting.android.framework.util.b.a(paramString, 2.0F);
            this.f = com.ximalaya.ting.android.framework.util.b.a(this.d, 12.0F);
            String str;
            this.g = str;
        }

        private void a(View paramView, int paramInt)
        {
            int i = this.c.size();
            Object localObject1 = (FrameLayout)paramView.findViewById(R.id.main_content_bg_fl);
            if (BaseFragmentActivity2.sIsDarkMode)
            {
                ((FrameLayout)localObject1).setBackgroundResource(R.drawable.main_podcast_daily_choose_dark_bg);
            }
            else if (!TextUtils.isEmpty(this.g))
            {
                localObject1 = (ImageView)paramView.findViewById(R.id.main_bg_iv);
                ImageManager.b(this.d).b((ImageView)localObject1, this.g, -1, Bitmap.Config.ARGB_8888, new -..Lambda.DailyChooseAdapter.b.o-eeCEKTMEzoYWoSfzy1dYxr9vM((ImageView)localObject1));
            }
            HomeDailyChoiceItemVO localHomeDailyChoiceItemVO = (HomeDailyChoiceItemVO)this.c.get(paramInt % i);
            if (localHomeDailyChoiceItemVO != null)
            {
                localObject1 = (TextView)paramView.findViewById(R.id.main_album_title_tv);
                if (!TextUtils.isEmpty(localHomeDailyChoiceItemVO.getAlbumTitle())) {
                    ((TextView)localObject1).setText(localHomeDailyChoiceItemVO.getAlbumTitle());
                }
                localObject1 = (TextView)paramView.findViewById(R.id.main_item_track_title_tv);
                if (!TextUtils.isEmpty(localHomeDailyChoiceItemVO.getTrackTitle())) {
                    ((TextView)localObject1).setText(localHomeDailyChoiceItemVO.getTrackTitle());
                }
                TextView localTextView = (TextView)paramView.findViewById(R.id.main_track_play_count_tv);
                localTextView.setText(z.d(localHomeDailyChoiceItemVO.getPlayCount()));
                Object localObject3 = this.d.getResources().getDrawable(R.drawable.main_podcast_play_arrow).mutate();
                if (BaseFragmentActivity2.sIsDarkMode) {
                    localObject1 = "#CFCFCF";
                } else {
                    localObject1 = "#EEB0AB";
                }
                ((Drawable)localObject3).setColorFilter(Color.parseColor((String)localObject1), PorterDuff.Mode.SRC_ATOP);
                Object localObject2 = null;
                localTextView.setCompoundDrawablesWithIntrinsicBounds((Drawable)localObject3, null, null, null);
                localTextView.setCompoundDrawablePadding(this.e);
                localTextView = (TextView)paramView.findViewById(R.id.main_comment_tv);
                if (!TextUtils.isEmpty(localHomeDailyChoiceItemVO.getRemarkNickname()))
                {
                    paramView = new SpannableString(localHomeDailyChoiceItemVO.getRemarkNickname());
                    paramView.setSpan(new ForegroundColorSpan(this.d.getResources().getColor(R.color.host_color_666666_cfcfcf)), 0, localHomeDailyChoiceItemVO.getRemarkNickname().length(), 33);
                    paramView.setSpan(new StyleSpan(1), 0, localHomeDailyChoiceItemVO.getRemarkNickname().length(), 33);
                }
                else
                {
                    paramView = null;
                }
                if (localHomeDailyChoiceItemVO.isRemarkOfAuthor())
                {
                    localObject1 = new SpannableString("test");
                    localObject3 = this.d;
                    Resources localResources = ((Context)localObject3).getResources();
                    paramInt = R.drawable.main_anchor_mic;
                    i = this.f;
                    ((SpannableString)localObject1).setSpan(new p((Context)localObject3, c.a(localResources, paramInt, i, i), 0, 2), 0, 4, 17);
                }
                else
                {
                    localObject1 = null;
                }
                if (!TextUtils.isEmpty(localHomeDailyChoiceItemVO.getTrackRemark()))
                {
                    localObject2 = new StringBuilder();
                    ((StringBuilder)localObject2).append("���");
                    ((StringBuilder)localObject2).append(localHomeDailyChoiceItemVO.getTrackRemark());
                    localObject2 = new SpannableString(((StringBuilder)localObject2).toString());
                    ((SpannableString)localObject2).setSpan(new ForegroundColorSpan(this.d.getResources().getColor(R.color.host_color_666666_cfcfcf)), 0, localHomeDailyChoiceItemVO.getTrackRemark().length(), 33);
                }
                localObject3 = new SpannableStringBuilder();
                if (paramView != null) {
                    ((SpannableStringBuilder)localObject3).append(paramView);
                }
                if (localObject1 != null) {
                    ((SpannableStringBuilder)localObject3).append((CharSequence)localObject1);
                }
                if (localObject2 != null) {
                    ((SpannableStringBuilder)localObject3).append((CharSequence)localObject2);
                }
                localTextView.setText((CharSequence)localObject3);
                DailyChooseAdapter.a(DailyChooseAdapter.this, localHomeDailyChoiceItemVO.getTrackId());
            }
        }

        public void a(int paramInt, float paramFloat)
        {
            View localView = (View)this.b.get(paramInt);
            if (localView != null)
            {
                float f1 = paramFloat;
                if (paramFloat < 0.0F) {
                    f1 = 0.0F;
                }
                localView.setAlpha(f1);
            }
        }

        public void destroyItem(ViewGroup paramViewGroup, int paramInt, Object paramObject)
        {
            paramViewGroup.removeView((View)paramObject);
            this.b.delete(paramInt);
        }

        public int getCount()
        {
            return Integer.MAX_VALUE;
        }

        public Object instantiateItem(ViewGroup paramViewGroup, int paramInt)
        {
            View localView = com.ximalaya.commonaspectj.a.a(LayoutInflater.from(paramViewGroup.getContext()), R.layout.main_podcast_daily_choose_page_item, paramViewGroup, false);
            if (localView != null)
            {
                a(localView, paramInt);
                this.b.put(paramInt, localView);
            }
            paramViewGroup.addView(localView);
            return localView;
        }

        public boolean isViewFromObject(View paramView, Object paramObject)
        {
            return paramView == paramObject;
        }
    }

    class c
            extends Handler
    {
        private WeakReference<DailyChooseAdapter.a> b;

        public c(DailyChooseAdapter.a parama)
        {
            super();
            this.b = new WeakReference(parama);
        }

        public void handleMessage(Message paramMessage)
        {
            if (paramMessage.what == 1)
            {
                paramMessage = null;
                WeakReference localWeakReference = this.b;
                if (localWeakReference != null) {
                    paramMessage = (DailyChooseAdapter.a)localWeakReference.get();
                }
                if (DailyChooseAdapter.a(DailyChooseAdapter.this))
                {
                    return;
                }
                if ((DailyChooseAdapter.this.g()) && (paramMessage != null) && (paramMessage.t != null)) {
                    paramMessage.t.setCurrentItem(DailyChooseAdapter.b(DailyChooseAdapter.this) + 1);
                }
                sendMessageDelayed(obtainMessage(1), 5000L);
            }
        }
    }
}

